package com.cloud.tsp.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cloud.api.domain.report.VehicleOffline;
import com.cloud.api.domain.stats.OfflineVehicleVo;
import com.cloud.api.domain.stats.VehicleStats;
import com.cloud.api.domain.sys.DictTypeQuery;
import com.cloud.api.domain.tsp.*;
import com.cloud.api.domain.algorithm.VehiclePoint;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * OLAP Mapper 接口
 * </p>
 *
 * @author haohaibo
 * @since 2023-12-01
 */
@DS("doris")
public interface VehicleMessageDailyMapper extends BaseMapper<VehicleMessageDaily> {

    List<VinLockStatus> selectStatusByVin(@Param("ids") List<String> para,@Param("c") QueryVehicle a);

    VehicleLocation selectVehicleLocation(@Param("vin")String vin);

    IPage<VinLockStatus> selectVinList(IPage<?>page, @Param("c") QueryVehicle para);

    IPage<VinLockStatus> selectAllVinListTsp(IPage<?>page, @Param("c") QueryVehicle para);

    IPage<VinLockStatus> selectLineVinList(IPage<?>page, @Param("c") QueryVehicle para);

    IPage<VinLockStatus> selectLineVinListTsp(IPage<?>page, @Param("c") QueryVehicle para);

    List<VehicleStats> selectOnlineVehicleCount(@Param("dataSource") String dataSource);

    IPage<OfflineVehicleVo> selectOfflineVehicle(IPage<?>page, @Param("c") DictTypeQuery para);

    List<OfflineVehicleVo> selectAllOfflineVehicle(@Param("c") DictTypeQuery para);

    List<VinDetail> getAllVehicleLocation(@Param("c") QueryVehicleMap para);
    IPage<VinDetail> getAllVehicleLocationPage(IPage<?> page,@Param("dataSource") String dataSource);

    List<VehicleStats> getOnlineVehicleTypeCount(@Param("dataSource") String dataSource,@Param("second") Integer second);

    List<VehicleSale> getOnlineVehicleModelCount(@Param("dataSource") String dataSource);

    Integer selectOnlineCountTotal(@Param("dataSource") String dataSource,@Param("second") Integer second);

    Integer getOnlineToday(@Param("dataSource") String dataSource);

    List<VehicleOffline> selectOfflineList(@Param("dataSource") String dataSource);

    IPage<VehicleOffline> selectOffList(IPage<?> page, @Param("dataSource") String dataSource);

    List<VehiclePoint> getAggVehicleMessage(@Param("parkTime") Integer parkTime, @Param("dataSource") String dataSource);

    Boolean isOnline(@Param("c")QueryVehicleMap para);
}